import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
// import 'package:fluwx/fluwx.dart';
import 'package:star_author/config/ui_constant.dart';
import 'package:star_author/utils/common_util/toast/custom_toast.dart';
import 'package:star_author/widgets/dialog/bottom_sheet.dart';
import 'package:star_author/widgets/empty_view/h_empty_view.dart';
import 'package:star_author/widgets/empty_view/v_empty_view.dart';
// import 'package:fluwx/fluwx.dart' as fluwx;

class WxHandler {
  static Widget shareItem(String title, String image, Function() callback) {
    return GestureDetector(
      onTap: callback,
      behavior: HitTestBehavior.opaque,
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Image.asset(
            image,
            width: 48.w,
            height: 48.w,
          ),
          VEmptyView(8.w),
          Text(
            title,
            style: TextStyle(
              fontSize: 14.sp,
              color: UIConstant.color33,
            ),
          ),
        ],
      ),
    );
  }
  //
  // static void share(
  //     {String title = '向你推荐「回流」APP',
  //     String h5Url = '',
  //     String description = '一个竞价回收的珠宝玉翠闲置交易平台',
  //     String thumbnail = 'images/ic_logo_white_lt.png'}) async {
  //   bool isWeChatInstalled = await fluwx.isWeChatInstalled;
  //   if (!isWeChatInstalled) {
  //     CustomToast.show("未安装微信!");
  //     return;
  //   }
  //   showMyBottomSheet(
  //     Container(
  //       padding: EdgeInsets.only(
  //         top: 24.w,
  //         bottom: 40.w + ScreenUtil().bottomBarHeight,
  //       ),
  //       decoration: BoxDecoration(
  //         borderRadius: BorderRadius.vertical(top: Radius.circular(12.w)),
  //         color: Colors.white,
  //       ),
  //       child: Column(
  //         mainAxisAlignment: MainAxisAlignment.center,
  //         children: [
  //           Text(
  //             "分享链接至",
  //             style: TextStyle(
  //               color: UIConstant.color33,
  //               fontSize: 14.sp,
  //             ),
  //           ),
  //           VEmptyView(20.w),
  //           Row(
  //             mainAxisAlignment: MainAxisAlignment.center,
  //             children: [
  //               shareItem("微信", "images/ic_share_wx_session_lt.png", () {
  //                 var model = fluwx.WeChatShareWebPageModel(
  //                   h5Url,
  //                   title: title,
  //                   description: description,
  //                   scene: WeChatScene.SESSION,
  //                   thumbnail: WeChatImage.asset(thumbnail),
  //                 );
  //                 fluwx.shareToWeChat(model);
  //               }),
  //               HEmptyView(99.w),
  //               shareItem("朋友圈", "images/ic_share_wx_timeline_lt.png", () {
  //                 var model = fluwx.WeChatShareWebPageModel(
  //                   h5Url,
  //                   title: title,
  //                   description: description,
  //                   scene: WeChatScene.TIMELINE,
  //                   thumbnail: WeChatImage.asset(thumbnail),
  //                 );
  //                 fluwx.shareToWeChat(model);
  //               }),
  //             ],
  //           ),
  //         ],
  //       ),
  //     ),
  //   );
  // }
}
